<template>
    <div>
        <button @click="fetchData">加载loading</button>
        <!--Loader 变化的参数是 background 和 text  -->
        <Loader :background="bg" :text="text" v-if="!loading"></Loader>
    </div>
    
</template>
<script lang="ts" setup>
// import { useStore } from 'vuex'
import { ref } from 'vue'
import Loader from '../../components/common/loader/index.vue'
const loading = ref<boolean>(true);

let bg = 'rgba(237, 13, 13, 0.2);';
let text = '数据正在获取...'
function fetchData () {
    loading.value = !loading.value;
}
</script>
